package com.knowvoyage.knowvoyageserver.pojo.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "消息实体类")
@Data
public class Message {
    private Long messageId;

    @NotNull(message = "会话ID不能为空")
    @Positive(message = "会话ID必须为正数")
    private Long dialogId;

    @NotNull(message = "消息序号不能为空")
    @PositiveOrZero(message = "消息序号必须为非负数")
    private Integer number;

    @NotBlank(message = "提问内容不能为空")
    @Size(min = 1, max = 5000, message = "提问内容长度必须在1-5000个字符之间")
    private String ask;

    @Size(max = 10000, message = "回复内容长度不能超过10000个字符")
    private String reply;

    private LocalDateTime time;

    @PositiveOrZero(message = "消耗token数必须为非负数")
    private Integer tokens;
}
